<template>
  <div>
    <el-table
      ref="singleTable"
      :data="tableData"
      highlight-current-row
     
      style="width: 100%"
    >
      <el-table-column type="index" width="50"></el-table-column>
      <el-table-column property="authName" label="权限名称" width="220"></el-table-column>
      <el-table-column property="path" label="路径" width="220"></el-table-column>
      <el-table-column property="level" label="层级" width="220" >
          <template slot-scope="scope">
              <span v-if="scope.row.level === '0'">一级</span>
              <span v-else-if="scope.row.level === '1'">二级</span>
              <span v-else>三级</span>
          </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
    data(){
        return {
            tableData:[]
        }
    },

    mounted(){
        this.$axios({
            url:'rights/list',
            method:'get',
            headers: { Authorization: localStorage.getItem("token") }
        }).then(backdata=>{
            // console.log(backdata);
            this.tableData = backdata.data.data;
        })
    }
};
</script>

<style>
.has-gutter{
    line-height: 30px;
}
</style>
